package com.otp.model.test.template;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.otp.model.test.template.Attribute;

@Entity
@Table(name = "attribute_values")
public class AttributeValue implements java.io.Serializable{

	private static final long serialVersionUID = -3923739156456266677L;
	private long objectId;
	private String name;
	private String description;
	private Attribute attribute;
	private Integer order;


	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "object_id", unique = true, nullable = false)
	public Long getObjectId() {
		return objectId;
	}	
	public void setObjectId(Long objectId) {
		this.objectId = objectId;
	}

	@Column(name = "name")
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "description")
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}

	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name = "fk2attribute")
	public Attribute getAttribute() {
		return this.attribute;
	}
	public void setAttribute(Attribute attribute) {
		this.attribute = attribute;
	}
	
	@Column(name="order")
	public Integer getOrder(){
		return order;
	}
	public void setOrder(Integer order){
		this.order=order;
	}

}




